package com.esri.core.geometry;

import com.esri.core.geometry.Geometry;
import java.io.Serializable;

/* loaded from: classes.dex */
public final class Polyline extends MultiPath implements Serializable {
    private static final long serialVersionUID = 2;

    @Override // com.esri.core.geometry.Geometry
    public int getDimension() {
        return 1;
    }

    public Polyline() {
        this.m_impl = new MultiPathImpl(false);
    }

    Polyline(VertexDescription vertexDescription) {
        this.m_impl = new MultiPathImpl(false, vertexDescription);
    }

    @Override // com.esri.core.geometry.Geometry
    public Geometry createInstance() {
        return new Polyline(getDescription());
    }

    @Override // com.esri.core.geometry.Geometry
    public Geometry.Type getType() {
        return Geometry.Type.POLYLINE;
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        if (obj.getClass() != getClass()) {
            return false;
        }
        return this.m_impl.equals(((Polyline) obj)._getImpl());
    }

    @Override // com.esri.core.geometry.MultiPath
    public int hashCode() {
        return this.m_impl.hashCode();
    }

    @Override // com.esri.core.geometry.MultiPath
    public void addSegment(Segment segment, boolean z) {
        this.m_impl.addSegment(segment, z);
    }

    @Override // com.esri.core.geometry.Geometry
    public boolean isValid() {
        for (int i = 0; i < getPathCount(); i++) {
            if (getPathSize(i) > 1) {
                return true;
            }
        }
        return false;
    }
}
